# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=pwfuzz-rs
pkgver=v0.2.0.r1.gac56f42
pkgrel=1
pkgdesc='Rust-based password mutator for brute force attacks.'
arch=('x86_64' 'aarch64')
groups=('blackarch' 'blackarch-misc')
url='https://github.com/mttaggart/pwfuzz-rs'
license=('MIT')
depends=()
makedepends=('git' 'cargo')
source=("git+https://github.com/mttaggart/$pkgname.git")
sha256sums=('SKIP')

pkgver() {
  cd $pkgname

  git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
  cd $pkgname

  cargo build --release --locked
}

package() {
  cd $pkgname

  install -Dm 755 "target/release/$pkgname" "$pkgdir/usr/bin/$pkgname"
  install -Dm 644 README.md -t "$pkgdir/usr/share/doc/$pkgname"
  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

